<template>
  <div class="news">
    <ul class="mui-table-view">
    <li class="mui-table-view-cell mui-media" v-for="(item, index) in newslist" :key="index">
        <router-link :to="'/home/news/newscontent/' + item.id">
            <img class="mui-media-object mui-pull-left" :src="item.img_url">
            <div class="mui-media-body">
                <p>{{ item.title }}</p>
                <div class="content-title">
                  <span>{{ item.add_time | dataFormat}}</span>
                  <span>{{ item.zhaiyao }}</span>
                </div>
            </div>
        </router-link>
    </li>
</ul>
  </div>
</template>

<script>
export default {
  data(){
    return {
      newslist: []                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    }
  },
  created(){
    this.$http.get('api/getnewslist').then(res => {
      if(res.body.status === 0){
        this.newslist = res.body.message
      }    
    })
  }
}
</script>

<style lang="less" scoped>

</style>
